const express = require('express');
var router = express.Router();
const userCtrl = require('../controllers/user.server.controller');

router.route('/user')
    .get(userCtrl.findUser)//登录
    .post(userCtrl.addUser)//注册，注册时还需加get /user?account=xxx

router.route('/user/:_id')
    .get(userCtrl.findUserById)
    .put(userCtrl.updateInfo)//订单预览新增地址处修改地址与userInfo中的修改地址与password

router.route('/session')
    .get(userCtrl.getSession)
    .put(userCtrl.clearSession)

module.exports = router;